<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>




    </head>
    <body>
       <h1 id="ddt">请开始你的表演</h1>
        <button id="start">开始</button>
        <button id="end">结束</button>
 
        <script>
            var txt=document.getElementById('ddt');

            var start=document.getElementById('start');

            var end=document.getElementById('end');
            var user=['前端','前端','王五','哈哈','呵呵','嘻嘻','端午节快乐','6-12'];
            var busy;
            
            start.onclick=function(){
               
                clearInterval(busy)
               busy=setInterval(function(){
                    var n=parseInt(Math.random()*user.length);
                    ddt.innerHTML=user[n];
                },100)
            }
            end.onclick=function(){
            
                

                clearInterval(busy)
            }
        </script>
    </body>
</html>
